﻿using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Linq;
using System.Linq.Expressions;
using System.Text;


namespace ArmaTuCumple.Model.Repository
{
    public class RepositorioServicios:IRepositorio<Servicio>
    {
        readonly ArmaTuCumple.Model.Repository.ArmaTuCumpleLinqDataContext dataContext;

        public RepositorioServicios()
             {
                 dataContext = new ArmaTuCumpleLinqDataContext();
             }

        public virtual void InsertOnSubmit(Servicio servicio)
        {
            GetTable().InsertOnSubmit(servicio);
           
        }

        public virtual ITable GetTable()
        {
            return dataContext.GetTable<Servicio>();
        }

        public IQueryable<Servicio> GetAll()
        {
            return dataContext.GetTable<Servicio>();
        }

        public void DeleteOnSubmit(Servicio entity)
        {
            GetTable().DeleteOnSubmit(entity);
        }

        public void SubmitChanges()
        {
            dataContext.SubmitChanges();
        }
    }
}
